package idiet.service;

import idiet.bean.MealTaste;
import idiet.dao.hibernate.MealTasteDao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository("mealTasteService")
public class MealTasteService {
	@Autowired
	MealTasteDao mealTasteDao;
	public MealTaste getMealTasteById(int mealTasteId){
		return this.mealTasteDao.getMealTasteById(mealTasteId);
	}
	public List<MealTaste> getMealTastesByMealTasteName(String mealTasteName){
		if(mealTasteName==null){
			return this.mealTasteDao.getMealTastes();
		}else{
			return this.mealTasteDao.getMealTastesByMealTasteName(mealTasteName);
		}
	}
	public void createMealTaste(MealTaste mealTaste){
		this.mealTasteDao.createMealTaste(mealTaste);
	}
	public void updateMealTaste(MealTaste mealTaste){
		this.mealTasteDao.updateMealTaste(mealTaste);
	}
	public void deleteMealTaste(MealTaste mealTaste){
		this.mealTasteDao.deleteMealTaste(mealTaste);
	}
}
